rbtree: add const qualifier to some functions
authorArtem Bityutskiy <Artem.Bityutskiy@nokia.com>
Tue, 20 Jun 2017 12:49:40 +0000 (14:49 +0200)
committerJan Beulich <jbeulich@suse.com>
Tue, 20 Jun 2017 12:49:40 +0000 (14:49 +0200)
commitb2f178fb3576d459abbb0a0db14781003d4b01c5
tree12deb641017d19e80b00bd8110eb9768496f308d
parent9b62c90308982a044e671361f1e6410f49c00aca
rbtree: add const qualifier to some functions

The 'rb_first()', 'rb_last()', 'rb_next()' and 'rb_prev()' calls
take a pointer to an RB node or RB root. They do not change the
pointed objects, so add a 'const' qualifier in order to make life
of the users of these functions easier.

Indeed, if I have my own constant pointer &const struct my_type *p,
and I call 'rb_next(&p->rb)', I get a GCC warning:

warning: passing argument 1 of \91rb_next\92 discards qualifiers from pointer target
type

Signed-off-by: Artem Bityutskiy <Artem.Bityutskiy@nokia.com>
Signed-off-by: David Woodhouse <David.Woodhouse@intel.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[Linux commit f4b477c47332367d35686bd2b808c2156b96d7c7]

Ported to Xen.

Signed-off-by: Praveen Kumar <kpraveen.lkml@gmail.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
xen/common/rbtree.c
xen/include/xen/rbtree.h